package ytdp.careagle.com.ytdp.entity;

import com.google.gson.Gson;
import com.mcxtzhang.indexlib.IndexBar.bean.BaseIndexPinyinBean;

import java.util.List;

/**
 * Created by lida on 2017/7/31 0031.
 */

public class BrandRelationship {

    /**
     * initialsLetter : A
     * children : [{"code":"brand-548","country":"car_country_china","countryName":"中国","createdDate":1424966400000,"enName":"安凯客车","hide":0,"id":"9d03c4b63d4a46c0beae66c7713b067d","image":"http://img.souche.com/files/carproduct/brand/brand-548.png","initialsLetter":"A","level":"common-self","name":"安凯客车","pinyin":"ankaikeche","updateDate":1480867200000},{"code":"brand-13","country":"car_country_england","countryName":"英国","createdDate":1424966400000,"enName":"阿斯顿・马丁","hide":0,"id":"3d224bb90f064ecca10d8dcaa62ae3af","image":"http://img.souche.com/files/carproduct/brand/brand-13.png","initialsLetter":"A","level":"sporty","name":"阿斯顿・马丁","pinyin":"asidun・mading","updateDate":1439481600000},{"code":"brand-12","country":"car_country_italia","countryName":"意大利","createdDate":1424966400000,"enName":"阿尔法罗密欧","hide":0,"id":"57714e4e590f4b09929d7fda840c210f","image":"http://img.souche.com/files/carproduct/brand/brand-12.png","initialsLetter":"A","level":"luxury","name":"阿尔法罗密欧","pinyin":"aerfaluomiou","updateDate":1439481600000},{"code":"brand-15","country":"car_country_germany","countryName":"德国","createdDate":1424966400000,"enName":"奥迪","hide":0,"id":"869c5fac81bd40bd92335a70485513d0","image":"http://img.souche.com/files/carproduct/brand/brand-15.png","initialsLetter":"A","level":"luxury","name":"奥迪","pinyin":"aodi","updateDate":1439481600000}]
     */

    private String initialsLetter;
    private List<ChildrenBean> children;

    public static BrandRelationship objectFromData(String str) {

        return new Gson().fromJson(str, BrandRelationship.class);
    }

    public String getInitialsLetter() {
        return initialsLetter;
    }

    public void setInitialsLetter(String initialsLetter) {
        this.initialsLetter = initialsLetter;
    }

    public List<ChildrenBean> getChildren() {
        return children;
    }

    public void setChildren(List<ChildrenBean> children) {
        this.children = children;
    }

    public static class ChildrenBean extends BaseIndexPinyinBean {
        /**
         * code : brand-548
         * country : car_country_china
         * countryName : 中国
         * createdDate : 1424966400000
         * enName : 安凯客车
         * hide : 0
         * id : 9d03c4b63d4a46c0beae66c7713b067d
         * image : http://img.souche.com/files/carproduct/brand/brand-548.png
         * initialsLetter : A
         * level : common-self
         * name : 安凯客车
         * pinyin : ankaikeche
         * updateDate : 1480867200000
         */

        private String initialsLetter;
        private String code;
        private String name;
        private String pinyin;
        private String image;

        public static ChildrenBean objectFromData(String str) {

            return new Gson().fromJson(str, ChildrenBean.class);
        }

        public String getName() {
            return name;
        }

        public String getImage() {
            return image;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public void setImage(String image) {
            this.image = image;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPinyin() {
            return pinyin;
        }

        public void setPinyin(String pinyin) {
            this.pinyin = pinyin;
        }

        @Override
        public String getTarget() {
            return initialsLetter;
        }
    }
}